
public class TestAnimal
{
  public static void eat(Animal a){
     a.eat();
  }

   public static void main(String[] args) {
      Cat cat=new Cat("阿花",2);
      Dog dog=new Dog("阿财",5);
      eat(cat);
      eat(dog);
   }
}

/*class B {
    public int Func() {
        System.out.print("B");
        return 0;
    }
}
class D extends B {
    @Override
    public int Func() {
        System.out.print("D");
        return 0;
    }
}
public class Test {
    public static void main(String[] args) {
        B a = new B();
        B b = new D();
        a.Func();
        b.Func();
    }
}*/
/*
public class Person{

    private String name = "Person";

    int age=0;

}

public class Child extends Person{

    public String grade;

    public static void main(String[] args){

        Person p = new Child();

        System.out.println(p.name);

    }

}*/
